
#include ".\color.h"

namespace Graphics
{
	Color::Color(byte r,byte g,byte b,byte a):m_Red(r),m_Blue(b),m_Green(g),m_Alpha(a)
	{
	}
	Color::Color(void):m_Red(0),m_Blue(0),m_Green(0),m_Alpha(0xff)
	{
	}
	Color::~Color(void)
	{
	}

	// Return the DWORD value, format is 0xAARRGGBB.
	DWORD Color::GetDWORD(void) const
	{
		return ((DWORD)((((m_Alpha)&0xff)<<24)|(((m_Red)&0xff)<<16)|(((m_Green)&0xff)<<8)|((m_Blue)&0xff)));
	}

	// Get/Set the colors
	void Color::Set(byte r,byte g,byte b,byte a)
	{
		m_Red = r;
		m_Blue = b;
		m_Green = g;
		m_Alpha = a;
	}

	byte Color::GetRed() const
	{
		return m_Red;
	}
	void Color::SetRed(byte red)
	{
		m_Red = red;
	}
	byte Color::GetBlue() const
	{
		return m_Blue;
	}
	void Color::SetBlue(byte blue)
	{
		m_Blue = blue;
	}
	byte Color::GetGreen() const
	{
		return m_Green;
	}
	void Color::SetGreen(byte green)
	{
		m_Green = green;
	}
	byte Color::GetAlpha(void) const
	{
		return m_Alpha;
	}
	void Color::SetAlpha(byte alpha)
	{
		m_Alpha = alpha;
	}
};